<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<title></title>
</head>

<body>
<script type="text/javascript">
    function addPic(){
        resultDiv = document.createElement("div");//创建div元素
        resultDiv.innerHTML = "<img src='images/success.png' width='100%' height='100%'>";//为div设置图片
        document.body.appendChild(resultDiv);//向body中添加div元素
    }
</script>
<input type="button" id="but" value="添加" onclick="addPic()">
</body>
</html>
